package my.controller;

import my.domain.Items;
import my.service.ItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;



@Controller
@RequestMapping("/items")
public class ItemsController {
    @Autowired
    private ItemsService service;

    @RequestMapping("/findOne")
    public String findOne(Model model){
        Items items = service.findById(2);
        model.addAttribute("item",items);
        return "itemDetail";
    }
}
